<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>信息管理系统界面</title>
    <link href="../style/css/style.css" rel="stylesheet" type="text/css" />

    <style type="text/css">
        *{
            margin: 0px;
            padding: 0px;
        }
    </style>
    <script src="../style/js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function (){
            var  account =window.sessionStorage.getItem("account");
            var id = window.sessionStorage.getItem("id");
            var type = window.sessionStorage.getItem("type");
            //获取用户新文件名
            var  newFileName =window.sessionStorage.getItem("newFileName");
            if (account==null){
                location.replace("login.html");
                return;
            }
            $.get("../login/menulist",{id:id,type:type},function (data) {
                if (data.code==201||data.code==500){
                    alert(data.msg);
                }else if(data.code==200){
                    var  str="";
                    for (var i = 0; i < data.data.length; i++) {
                        str+="<li><cite></cite>";
                        str+="<a href='"+data.data[i].url+"' target='rightFrame'>"+data.data[i].name+"</a>";
                        str+="</li>";
                    }
                    $("#menuId").html(str);
                }
            })
            $("#accountId").html(account);

            if(prasestr(newFileName).length!=0){
                /*   alert("notnull");
                   alert(newFileName);*/
                var imgsrc =  "http://127.0.0.1:8080/UploadImg/"+account+"/"+newFileName;
                document.getElementById("imgId").innerHTML = "<img src='"+imgsrc+"' width='50' height='50'/>";
            }else {
                alert("nulllll");
            }

        })
        function prasestr(str) {
            if (!str||str=="undefined"||str=="null"){
                return "";
            }
            return str;
        }
        function exit() {
            if (confirm("你确定要退出吗？")){
                window.sessionStorage.clear();
                $.get("../login/loginOut",function (res){
                    console.log(res);
                    location.replace("login.html");
                })
            }
        }
    </script>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0" width="100%" height="100%">
    <tr style="background:url(../style/img/adminMainPicture/topbg.gif) repeat-x;">
        <td colspan="2">
            <div class="topleft">
                <img src="../style/img/adminMainPicture/logo.png" title="系统首页" />
            </div>
            <div class="topright">
                <ul>
                    <li><span><img src="../style/img/adminMainPicture/help.png" title="帮助"  class="helpimg"/></span><a href="#">帮助</a></li>
                    <li><a href="#">关于</a></li>
                    <li><a href="javaScript:void(0)" onclick="exit()" >退出</a></li>
                    <li id="imgId"><a href="upload.html" target="rightFrame">上传头像</a></li>
                </ul>
                <div class="user">
                    <span id="accountId"></span>
                </div>
            </div>
        </td>
    </tr>
    <tr>
        <td width="187" valign="top"  height="100%"  style="background:#f0f9fd;">
            <div class="lefttop"><span></span>操作菜单</div>
            <dl class="leftmenu">
                <dd>
                    <div class="title">
                        <span><img src="../style/img/adminMainPicture/leftico01.png" /></span>
                        <a href="">管理信息</a>
                    </div>
                    <ul class="menuson" id="menuId">

                    </ul>
                </dd>
            </dl>
        </td>
        <td>
            <iframe name="rightFrame" src="" width="100%" height="600"></iframe>
        </td>
    </tr>
</table>
</body>
</html>
